package com.hui.blog_server.controller;

import com.hui.blog_server.entity.Blogs;
import com.hui.blog_server.entity.ResponseResult;
import com.hui.blog_server.entity.Tags;
import com.hui.blog_server.mapper.TagsMapper;
import com.hui.blog_server.service.BlogsService;
import com.hui.blog_server.service.TagsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 彩色的小灰
 */
@RestController
public class BlogsController {

    @Autowired
    private BlogsService blogsService;
    @Autowired
    private TagsService tagsService;

    @GetMapping("/blogs")
    public ResponseResult<List<Blogs>> blogs() {
        List<Blogs> blogs = blogsService.getAllBlogs();
        return ResponseResult.success(blogs);
    }
}
